
-- {ap0:ap0, ap1:ap1...} map
wifiAps = {}

function getTmpAps()
    return wifiAps
end
--- scan current aps
function getAps(t)
    local aps = {}
    for bssid,v in pairs(t) do
        local tmp_ssid, rssi, authmode, channel = string.match(v, "([^,]+),([^,]+),([^,]+),([^,]*)")
        if(__check_ssid(tmp_ssid)) then
            aps[tmp_ssid] = tmp_ssid
            --index = index + 1
        end
    end
    wifiAps = aps
    return wifiAps
end

--- only allow [a-zA-Z0-9_-]
function __check_ssid(ssid) 
    local after = string.match(ssid, "[a-zA-Z0-9_-]+")
    return after
end
